package com.zxd.socket;

import java.io.IOException;
import java.net.*;
import java.nio.charset.StandardCharsets;

/**
 * ClassName:MyClint
 * Package:com.zxd.socket
 *
 * @Date:2023/9/28 20:28
 * @Author:zxde
 */
public class MyClint {
    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket = new DatagramSocket();
        byte[] bytes = "你好，我是朱行德".getBytes(StandardCharsets.UTF_8);
        DatagramPacket datagramPacket = new DatagramPacket(bytes, bytes.length, InetAddress.getLocalHost(), 6666);
        datagramSocket.send(datagramPacket);
        datagramSocket.close();
    }
}
